<?php
Zend::loadClass('Lead_EDO_Datatype_Numeric');

/**
 * Datatype for integer
 *
 * @package EDO
 * @subpackage Datatypes
 *
 */
class Lead_EDO_Datatype_Tinyint extends Lead_EDO_Datatype_Numeric
{
	protected $_SQLValueIsQuoted = false;




	public function validate($validate)
	{
		if(!$this->notNull() AND empty($validate) AND !is_numeric($validate))
    	   return null;

    	if(!is_numeric($validate))
			return false;

	    if ((string)$validate !== (string)(int)$validate)
	       return false;



		if($validate < -127 OR $validate > 127)
			 return false;

		return $validate;
	}
}